package com.lmk.t02;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Locale;

public class Test06 {
    public static void main(String[] args) throws UnsupportedEncodingException {
       /* String s="我爱北京天安门";
        byte[] date=s.getBytes("GBK");

        String s1=new String(date,"GBK");
        System.out.println(s1);
        char[] sc=s.toCharArray();
        System.out.println(Arrays.toString(sc));
       String s="abcbcccccccdegfc";
        System.out.println(s.indexOf("x"));
        System.out.println(s.indexOf("c",3));
        System.out.println(s.lastIndexOf("c"));
       String a=new String("abc");
       String b=new String("abc");
        System.out.println(a==b);
        System.out.println(a.intern()==b.intern());
        System.out.println(a.isEmpty());
        String s="吃1个葡萄不吐2个葡萄批";
        String s1=s.replace("葡萄","橘子");
        System.out.println(s1);
        String s2=s.replaceAll("葡萄","橘子");
        System.out.println(s2);
        String s3=s.replaceAll("\\d","几");
        System.out.println(s3
        );
        String s4=s.replaceFirst("葡萄","橘子");
        System.out.println(s4
        );
        String s="张三，李四，王五，赵六";
        String[] ss=s.split(",");
        System.out.println(Arrays.toString(ss));
        String s="https://b-ssl.duitang.com/uploads/blog/201307/22/20130722173939_PKzt4.jpeg?1264";
        int Sstart=s.lastIndexOf("/");
        int end=s.indexOf("?");
        String s1=s.substring(Sstart+1,end);
        System.out.println(s1);
        String s=" I  am  fine thank you";
        String s1=s.toLowerCase();
        System.out.println(s1);
        String s2=s.toUpperCase();
        System.out.println(s2);*/
        String s="    hello   wolrd     ";
        String s1=s.trim();
        System.out.println(s);
        System.out.println(s1);
    }
}
